home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / thinkref / archive / THINKPascalUH2.1.sea / THINKPas Univ Hdr 2.1 / Interfaces / ShutDown.p < prev    next >
Text File  |  1995-09-12  |  2KB  |  92 lines

  1. { Converted with MPW2TPas Tuesday, September 12, 1995 9:57:00 PM }
  2. {
  3.      File:        ShutDown.p
  4.  
  5.      Contains:    Shutdown Manager Interfaces.
  6.  
  7.      Version:    Technology:    System 7.5
  8.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  9.  
  10.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  14.                  stack.  Include the file and version information (from above)
  15.                  in the problem description and send to:
  16.                      Internet:    apple.bugs@applelink.apple.com
  17.                      AppleLink:    APPLE.BUGS
  18.  
  19. }
  20.  
  21.  UNIT ShutDown;
  22.  INTERFACE
  23.  
  24.  
  25. {$IFC UNDEFINED __SHUTDOWN__}
  26. {$SETC __SHUTDOWN__ := 1}
  27.  
  28.   USES
  29.    ConditionalMacros, Types, MixedMode;
  30.  
  31. { $PUSH}
  32. { $ALIGN MAC68K}
  33. { $LibExport+}
  34.  
  35. CONST
  36.     sdOnPowerOff                = 1;                            {call procedure before power off.}
  37.     sdOnRestart                    = 2;                            {call procedure before restart.}
  38.     sdOnUnmount                    = 4;                            {call procedure before unmounting.}
  39.     sdOnDrivers                    = 8;                            {call procedure before closing drivers.}
  40.     sdRestartOrPower            = 3;                            {call before either power off or restart.}
  41.  
  42. TYPE
  43.     {
  44.         ShutDwnProcPtr uses register based parameters on the 68k and cannot
  45.         be written in or called from a high-level language without the help of
  46.         mixed mode or assembly glue.
  47.  
  48.         In:
  49.          => shutDownStage    D0.W
  50.     }
  51.     ShutDwnProcPtr = Register68kProcPtr;  { register PROCEDURE ShutDwn(shutDownStage: INTEGER); }
  52.     ShutDwnUPP = UniversalProcPtr;
  53.  
  54. CONST
  55.     uppShutDwnProcInfo = $00001002; { Register PROCEDURE (2 bytes in D0); }
  56.  
  57. FUNCTION NewShutDwnProc(userRoutine: ShutDwnProcPtr): ShutDwnUPP;
  58.     {$IFC NOT GENERATINGCFM }
  59.     INLINE $2E9F;
  60.     {$ENDC}
  61.  
  62. PROCEDURE CallShutDwnProc(shutDownStage: INTEGER; userRoutine: ShutDwnUPP);
  63.     {$IFC NOT GENERATINGCFM}
  64.     {To be implemented:  Glue to move parameters into registers.}
  65.     {$ENDC}
  66.  
  67. PROCEDURE ShutDwnPower;
  68.     {$IFC NOT GENERATINGCFM}
  69.     INLINE $3F3C, $0001, $A895;
  70.     {$ENDC}
  71. PROCEDURE ShutDwnStart;
  72.     {$IFC NOT GENERATINGCFM}
  73.     INLINE $3F3C, $0002, $A895;
  74.     {$ENDC}
  75. PROCEDURE ShutDwnInstall(shutDownProc: ShutDwnUPP; flags: INTEGER);
  76.     {$IFC NOT GENERATINGCFM}
  77.     INLINE $3F3C, $0003, $A895;
  78.     {$ENDC}
  79. PROCEDURE ShutDwnRemove(shutDownProc: ShutDwnUPP);
  80.     {$IFC NOT GENERATINGCFM}
  81.     INLINE $3F3C, $0004, $A895;
  82.     {$ENDC}
  83.  
  84. { $ALIGN RESET}
  85. { $POP}
  86.  
  87. {$ENDC} {__SHUTDOWN__}
  88.  
  89.  IMPLEMENTATION
  90.  END.
  91.  
  92.